﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components {
    import flash.display.*;
    import net.wooga.pets.utils.*;

    public class AbstractView extends RenderListView {

        protected var _id:String;
        protected var _display:MovieClip;
        protected var _asset:MovieClip;
        protected var _state:String;

        public function AbstractView(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String){
            this._id = _arg1;
            this.setAsset(_arg4);
            this.x = _arg2;
            this.y = _arg3;
            this.initialize();
            this.createChildren();
            this.onChildrenCreated();
        }
        protected function setAsset(_arg1:String, _arg2:String=null):void{
            if (((_arg1) || (_arg2))){
                this._asset = AssetsLibrary.getMovieClip(_arg1, _arg2);
                if (!this._asset){
                    l(((("e could not find linkage " + _arg1) + " for ") + this._id));
                };
            };
        }
        public function setEnabled():void{
            mouseChildren = true;
            mouseEnabled = true;
            buttonMode = true;
            useHandCursor = true;
        }
        public function setDisabled():void{
            mouseChildren = false;
            mouseEnabled = false;
            buttonMode = false;
            useHandCursor = false;
        }
        public function isId(_arg1:String):Boolean{
            return ((this._id == _arg1));
        }
        public function get id():String{
            return (this._id);
        }
        public function setState(_arg1:String):void{
            this._state = _arg1;
            if (this._asset){
                this._asset.gotoAndStop(this._state);
            };
        }
        protected function clipHasInstanceName_animation(_arg1:MovieClip):Boolean{
            return (_arg1.animation);
        }
        public function remove():void{
            Displays.removeChild(this);
        }
        protected function initialize():void{
        }
        protected function createChildren():void{
            this._display = new MovieClip();
            addChild(this._display);
            if (this._asset){
                this._display.addChild(this._asset);
            };
        }
        protected function onChildrenCreated():void{
        }

    }
}//package net.wooga.pets.views.components 
